// 优惠券相关操作
import request,{Method} from '@/plugins/api.js'

export function getCouponByPage (params) {
    return request({
      url: '/coupon/coupon/getCouponByPage',
      method: Method.POST,
      data: params
    });
}

export function receiveCoupon(params){
  return request({
      url : `/member/membercouponrelation/receive/${params.memberId}/${params.couponId}`,
      method: Method.GET,
  })
}

// 用户领取优惠券
export function userReceiveCoupon (params) {
    return request({
      url: '/member/membercoupon/userReceiveCoupon',
      method: Method.POST,
      data: params
    });
}

// 获取买家端的优惠券分页数据
export function getBuyerCouponPage (params) {
    return request({
      url: '/coupon/coupon/getBuyerCouponPage',
      method: Method.POST,
      data: params
    });
}